package com.study.config;

import org.neo4j.driver.AuthTokens;
import org.neo4j.driver.Driver;
import org.neo4j.driver.GraphDatabase;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class Neo4jConfig {

    @Value("${spring.data.neo4j.uri}")
    private String url;// = "bolt://localhost:7687";

    @Value("${spring.data.neo4j.username}")
    private String username;// = "neo4j";

    @Value("${spring.data.neo4j.password}")
    private String password;// = "123456";

    @Bean
    public Driver driver() {
        return GraphDatabase.driver(url, AuthTokens.basic(username, password));
    }

    //    @Bean(name = "session")
//    public Session neo4jSession() {
//        return driver().session();
//    }

}
